<script>History.pushState(null, "Epicrisis", "<?php echo $this->here; ?>");</script>

<div id="encabezado_perfil">
	<div id="foto_perfil" style="width: 20%;max-height: 35px;"><a href="javascript:MostrarModal('ventana_modal','<?php __('Datos del Cliente'); ?>','/clients/edit/<?php echo $client['Client']['id']?>',650,650)" class="btn btn-success"><?php echo $client['Client']['name'] ?></a>
	</div>
	
	<div id="detalle_perfil">
		<?php
		 $ubicacion = trim($client['Client']['direccion'].' '.$client['Client']['localidad'].' '.$client['Client']['provincia'].' '.$countries[$client['Client']['country_id']]);
		?>
		<span class="etiquetas_tags fdo_gris"><?php echo $ubicacion; ?></span>
		<span class="etiquetas_tags fdo_gris"><?php echo $client['Client']['telefono']; ?></span>
		<span class="etiquetas_tags fdo_gris"><?php echo $client['Client']['email']; ?></span>
		<!-- <a href="/clients/pagos/<?php echo $client['Client']['id']?>" class="btn">Estado de Cuentas</a> -->
	</div>
</div>

<script type="text/javascript">
<?php 
	$remoteFunction2 = $ajax->remoteFunction( 
	    array( 
		'url' => array( 'controller' => 'clients_users', 'action' => 'index', $client['Client']['id'] ),
		'update' => 'panel_hce', 'indicator' => 'cargando' 
	    ) 
	);

	$remoteFunction3 = $ajax->remoteFunction( 
	    array( 
		'url' => array( 'controller' => 'agendas', 'action' => 'index', $client['Client']['id'] ),
		'update' => 'panel_hce', 'indicator' => 'cargando' 
	    ) 
	);

	$remoteFunction4 = $ajax->remoteFunction( 
	    array( 
		'url' => array( 'controller' => 'clients_feriados', 'action' => 'index', $client['Client']['id'] ),
		'update' => 'panel_hce', 'indicator' => 'cargando' 
	    ) 
	);

	$remoteFunction5 = $ajax->remoteFunction( 
	    array( 
		'url' => array( 'controller' => 'licenses', 'action' => 'index', $client['Client']['id'] ),
		'update' => 'panel_hce', 'indicator' => 'cargando' 
	    ) 
	);

	$remoteFunction6 = $ajax->remoteFunction( 
	    array( 
		'url' => array( 'controller' => 'combos', 'action' => 'index', $client['Client']['id'] ),
		'update' => 'panel_hce', 'indicator' => 'cargando' 
	    ) 
	);

	$remoteFunction7 = $ajax->remoteFunction( 
	    array( 
		'url' => array( 'controller' => 'clients_consumos', 'action' => 'index', $client['Client']['id'] ),
		'update' => 'panel_hce', 'indicator' => 'cargando' 
	    ) 
	);

	$remoteFunction8 = $ajax->remoteFunction( 
	    array( 
		'url' => array( 'controller' => 'clients_accesos', 'action' => 'index', $client['Client']['id'] ),
		'update' => 'panel_hce', 'indicator' => 'cargando' 
	    ) 
	);

	$remoteFunction9 = $ajax->remoteFunction( 
	    array( 
		'url' => array( 'controller' => 'clients_formularios', 'action' => 'index', $client['Client']['id'] ),
		'update' => 'panel_hce', 'indicator' => 'cargando' 
	    ) 
	);	

	$remoteFunction10 = $ajax->remoteFunction( 
	    array( 
		'url' => array( 'controller' => 'clients_sucursales', 'action' => 'index', $client['Client']['id'] ),
		'update' => 'panel_hce', 'indicator' => 'cargando' 
	    ) 
	);

	// Activo una Pestaña

	if(!empty($tab_activa)){
		switch($tab_activa){
			case 2:
				echo $remoteFunction2.";";
				break;
			case 3:
				echo $remoteFunction3.";";
				break;
			case 4:
				echo $remoteFunction4.";";
				break;
			case 5:
				echo $remoteFunction5.";";
				break;
			case 6:
				echo $remoteFunction6.";";
				break;
			case 7:
				echo $remoteFunction7.";";
				break;
			case 8:
				echo $remoteFunction8.";";
				break;
			case 9:
				echo $remoteFunction9.";";
				break;

			case 10:
				echo $remoteFunction10.";";
				break;

			default:
				echo $remoteFunction2.";";
				break;
		}
	}else{
		echo $remoteFunction2.";";
	}
?>
</script>
<div id="panel_izquierdo_config">
	<div></div>
	<div></div>
	<div id="menu_izq_config">
		<div id="mapa_cliente">
			<a href="javascript:MostrarMapa('ventana_modal','Domicilio','http://maps.googleapis.com/maps/api/staticmap?size=460x460&maptype=roadmap&zoom=16&markers=size:mid%7Ccolor:blue%7C<?php echo urlencode($ubicacion);?>&sensor=false',510,520)"><img src="http://maps.googleapis.com/maps/api/staticmap?size=100x100&maptype=roadmap&zoom=16&markers=size:mid%7Ccolor:blue%7C<?php echo urlencode($ubicacion);?>&sensor=false"></a>
		</div>
		<ul>
			<li><a href="#" onclick="<?php echo $remoteFunction10; ?>" class="btn btn-info btn-block"><?php __('Sucursales'); ?></a></li>					
			<li><a href="#" onclick="<?php echo $remoteFunction2; ?>" class="btn btn-info btn-block"><?php __('Usuarios'); ?></a></li>
			<li><a href="#" onclick="<?php echo $remoteFunction3; ?>" class="btn btn-info btn-block"><?php __('Agendas'); ?></a></li>
			<li><a href="#" onclick="<?php echo $remoteFunction9; ?>" class="btn btn-info btn-block"><?php __('Formularios'); ?></a></li>			
			<li><a href="#" onclick="<?php echo $remoteFunction4; ?>" class="btn btn-info btn-block"><?php __('Feriados'); ?></a></li>
			<li><a href="#" onclick="<?php echo $remoteFunction5; ?>" class="btn btn-info btn-block"><?php __('Licencias'); ?></a></li>
			<li><a href="#" onclick="<?php echo $remoteFunction8; ?>" class="btn btn-info btn-block"><?php __('Accesos'); ?></a></li>			
			<!-- <li><a href="#" onclick="<?php echo $remoteFunction7; ?>" class="link_destacado">Consumos</a></li> -->
			<!-- <li><a href="#" onclick="<?php echo $remoteFunction6; ?>" class="link_destacado">Combos</a></li> -->
		</ul>
	</div>
</div>
<div id="panel_derecho_config">
	<div id="panel_hce"><img src="/images/loading3.gif"></div>
</div>

<?php //pr($this->Session->read('Client'));?>